import time

from selenium.webdriver.common.by import By

from base.base_driver import ChromeDriver
from data.config import WebLoginURL, UserName, WebLoginUser, WebLoginPsd, Code, Password


def test_logiCommonTest(driver):
    driver.get(WebLoginURL)
    # time.sleep(2)  # 为了观察效果，可以调整或去掉
    driver.find_element(By.ID, 'password_name').send_keys(WebLoginUser)
    driver.find_element(By.ID, 'password_pwd').send_keys(WebLoginPsd)
    driver.find_element(By.ID, 'password_submitBtn').click()
    time.sleep(2)
    driver.find_element(By.XPATH, "//input[@placeholder='账号']").send_keys(UserName)
    driver.find_element(By.XPATH, "//input[@placeholder='密码']").send_keys(Password)
    driver.find_element(By.XPATH, "//input[@placeholder='验证码']").send_keys(Code)
    driver.find_element(By.XPATH, '//*[@id="app"]/div[1]/form/div[4]/div/button').click()
    time.sleep(2)  # 为了观察效果，可以调整或去掉
